package com.huixue.cn.ztej.servlet;

import javax.servlet.ServletContext;  
import javax.servlet.ServletException;  
import javax.servlet.http.HttpServlet;  
  
import org.springframework.web.context.WebApplicationContext;  
import org.springframework.web.context.support.WebApplicationContextUtils;  
public class T1 extends HttpServlet {  
	  
    public T1() {  
        super();  
    }  
  
    public void init() throws ServletException {  
        ServletContext sc = getServletContext();  
        WebApplicationContext ac = WebApplicationContextUtils.getRequiredWebApplicationContext(sc);  
  
        /*Service1 service = (Service1) ac.getBean("yourServiceId");  
        List list = service.getList();  */
        // list就是从数据库取到的内容，你可以做相关的处理  
    }  
}  
